<template>
  <div class="app-container">
    <el-tabs v-model="activeName">
        <el-tab-pane label="直接统计" name="first">
          <DirectStatistics ref="directStatistics" @reloadBaseList="getBaseList" :typeList="typeList" :baseList="baseList" :collegeList="collegeList"></DirectStatistics>
        </el-tab-pane>
        <el-tab-pane label="报告汇总" name="second">
          <ReportSummary ref="reportSummary" :typeList="typeList" :baseList="baseList" :collegeList="collegeList"></ReportSummary>
        </el-tab-pane>
      </el-tabs>
  </div>
</template>

<script>

import { getOrgByFunctionOpt } from "@/api/labdata/orgnization";
import { listBase } from "@/api/statistics/base";
import DirectStatistics from "./direct_statistics.vue"
import ReportSummary from "./report_summary.vue"

export default {
  name: "Base",
  components: {
    DirectStatistics,
    ReportSummary
  },
  data() {
    return {
      activeName: 'first',
			// 统计类型列表
			typeList: [
				{
					value: "1",
					label: '基表三 贵重仪器设备表(SJ3)'
				},{
					value: "2",
					label: '基表四 教学实验项目表(SJ4)'
				},{
					value: "3",
					label: '基表五 责任实验室人员表(SJ5)'
				},{
					value: "4",
					label: '基表六 实验室基本情况表(SJ6)'
				}
			],
      baseList: [],
      collegeList: []
    };
  },
  created() {
    this.getCollegeList()
    this.getBaseList()
  },
  methods: {
    // 查询学院
    getCollegeList(){
      getOrgByFunctionOpt(2).then(response => {
        this.collegeList = response.data
      });
    },
    /** 查询高基列表 */
    getBaseList() {
			const queryParams = {
        pageNum: 1,
        pageSize: 100
      }
      listBase(queryParams).then(response => {
        this.baseList = response.rows;
      });
    }
  }
};
</script>
